<?php

/**
 * Boek filter form base class.
 *
 * @package    jobeet
 * @subpackage filter
 * @author     Your name here
 */
abstract class BaseBoekFormFilter extends BaseFormFilterPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'ISBN'       => new sfWidgetFormFilterInput(),
      'titel'      => new sfWidgetFormFilterInput(),
      'auteur'     => new sfWidgetFormFilterInput(),
      'aantal'     => new sfWidgetFormFilterInput(),
      'afbeelding' => new sfWidgetFormFilterInput(),
    ));

    $this->setValidators(array(
      'ISBN'       => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'titel'      => new sfValidatorPass(array('required' => false)),
      'auteur'     => new sfValidatorPass(array('required' => false)),
      'aantal'     => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'afbeelding' => new sfValidatorPass(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('boek_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Boek';
  }

  public function getFields()
  {
    return array(
      'id'         => 'Number',
      'ISBN'       => 'Number',
      'titel'      => 'Text',
      'auteur'     => 'Text',
      'aantal'     => 'Number',
      'afbeelding' => 'Text',
    );
  }
}
